#ifndef FEIGTRAYICON_H
#define FEIGTRAYICON_H

#include <QWidget>
#include <QMenu>
#include <QSystemTrayIcon.h>

#include "ui_feigtrayicon.h"

class FeiGtrayIcon : public QWidget
{
	Q_OBJECT

public:
	FeiGtrayIcon(QWidget *parent = 0);
	~FeiGtrayIcon();
	void createTrayIcon();
	void createActions();
	void setIcon(int index);
	bool isAlert() const { return _alert; }
	void clearAlert() { _alert = false; }
private slots:
	void initIcon();
	void iconActivated(QSystemTrayIcon::ActivationReason reason);
	void showMessage();
	void messageClicked();
Q_SIGNALS:
	void postMsg();
public slots:
	void setAlert(bool alertstatu);;
	void changeIcon();
private:
	Ui::FeiGtrayIconClass ui;

	QAction *minimizeAction;
	//QAction *maximizeAction;
	QAction *ConfigAction;
	QAction *quitAction;

	QMenu * trayIconMenu;
	QSystemTrayIcon* trayIcon;
	QIcon  _icon[5];
	bool    _alert;

	QTimer* _timer;
	int    _iconnow;
	QString _toolTip[5];
};

#endif // FEIGTRAYICON_H
